package net.huashitong.common.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.common.dao.SysBriefingDao;
import net.huashitong.common.entity.SysBriefing;
import net.huashitong.common.filter.SysBriefingFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysBriefingService extends StringPKService<SysBriefing> {
    @Autowired
    private SysBriefingDao sysBriefingDao;
    @Autowired
    private SysTableService tableService;
    @Override
    protected BaseDao<SysBriefing, String> getDao() {
        return sysBriefingDao;
    }
    @Override
    protected void beforeSave(SysBriefing obj) {
        obj.setSysId(tableService.updateMaxSysId("t_common_briefing", null));
    }

    public List<SysBriefing> queryByFilter(SysBriefingFilter filter) {
        return sysBriefingDao.queryByFilter(filter);
    }

    public List<String> getTypes(){
        return sysBriefingDao.getTypes();
    }

    public List<SysBriefing> checkTitle(SysBriefingFilter filter) {
        return sysBriefingDao.checkTitle(filter);
    }
}
